-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: handle type error when skipToken
is present in suspense query
#8082
base: main
Are you sure you want to change the base?
refactor: handle type error when skipToken
is present in suspense query
#8082
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 41a9096. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@TkDodo To implement this, I had no choice but to add a new overload type to |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8082 +/- ##
=========================================
+ Coverage 0 82.28% +82.28%
=========================================
Files 0 26 +26
Lines 0 350 +350
Branches 0 92 +92
=========================================
+ Hits 0 288 +288
- Misses 0 53 +53
- Partials 0 9 +9
|
don’t think so |
I believe this PR is ready for review, and I would appreciate your feedback.
|
Summary
related: #8078 (reply in thread)
I improve DX(developer experience) by displaying an error during TypeScript type checking to indicate that
skipToken
cannot be used in Suspense Query.Details
queryFn
in the options for Suspense Query.queryOptions
andinfiniteQueryOptions
.I removed the
skipToken
type from Suspense Query and modified the types as follows to display an error whenskipToken
is assigned.While it was a good attempt, I couldn't pass the options using
queryOptions
(because of the differing types), so I had no choice but to add a new overload for Suspense Query inqueryOptions
.